package sk.tuke.constraintbuilder.model;

import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlTransient;

import sk.tuke.constraintbuilder.model.ConstraintPatterns.ContentType;
import sk.tuke.constraintbuilder.model.ConstraintPatterns.RuleType;


public class StructuredRuleElement extends RuleElement {
	
	private IElementOfStructuredElement element;
//	private ContentType contentType;
	
	@XmlElements({
		@XmlElement(name = "annotations", type = Annotations.class),
	    @XmlElement(name = "value", type = Value.class),
	    @XmlElement(name = "choice", type = Choice.class),
	    @XmlElement(name = "not", type = Not.class),
	})
	public IElementOfStructuredElement getElement(){
		return element;
	}
	
	public List<ILeaf> getLeaves(){
		if(element instanceof INodeElement){
			return ((INodeElement) element).getElements();
		}
		return null;
	}
	
	public void setElement(IElementOfStructuredElement element){
		this.element=element;
	}
//
//	@XmlAttribute
//	public ContentType getType() {
//		return contentType;
//	}
//
//	public void setType(ContentType type) {
//		this.contentType = type;
//	}
}
